package org.example.coffeeshoporderingsystem.order.entity;


import org.example.coffeeshoporderingsystem.common.enitty.BaseEntity;
import org.example.coffeeshoporderingsystem.product.entity.Product;


public class OrderDetail extends BaseEntity {
    private Integer detailId;
    private Order order;
    private Product product;
    private Integer quantity;
    private Double subtotal;

    public OrderDetail() {
    }

    public OrderDetail(Integer detailId, Order order, Product product, Integer quantity, Double subtotal) {
        this.detailId = detailId;
        this.order = order;
        this.product = product;
        this.quantity = quantity;
        this.subtotal = subtotal;
    }

    public Integer getDetailId() {
        return detailId;
    }

    public void setDetailId(Integer detailId) {
        this.detailId = detailId;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Double getSubtotal() {
        return subtotal;
    }

    public void setSubtotal(Double subtotal) {
        this.subtotal = subtotal;
    }

    @Override
    public String toString() {
        return "OrderDetail{" +
                "detailId=" + detailId +
                ", order=" + order +
                ", product=" + product +
                ", quantity=" + quantity +
                ", subtotal=" + subtotal +
                "} " + super.toString();
    }
}
